import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../components/home'
import Panorama from '../components/panorama'
import newPanorama from 'components/newPanorama/newPanorama.vue'
import panoramicList from 'components/newPanorama/panoramicList.vue'
import Panorama2 from '../components/panorama2'
import RiskDetail from '../components/riskDetail'

const originalPush = VueRouter.prototype.push

VueRouter.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
}

Vue.use(VueRouter)

const routes = [
    {
      path: '/home',
      name: 'Home',
      component: Home
    },
    {
        path: '/panorama',
        name: 'Panorama',
        component: Panorama
    },
    {
        path: '/newPanorama',
        name: 'newPanorama',
        component: newPanorama
    },
    {
        path: '/panoramicList',
        name: 'panoramicList',
        component: panoramicList
    },
    {
        path: '/panorama2',
        name: 'Panorama2',
        component: Panorama2
    },
    {
        path: '/riskDetail',
        name: 'RiskDetail',
        component: RiskDetail
    }
    // {
    //   path: '/about',
    //   name: 'About',
    //   // route level code-splitting
    //   // this generates a separate chunk (about.[hash].js) for this route
    //   // which is lazy-loaded when the route is visited.
    //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
    // }
]

const router = new VueRouter({
    routes
})

export default router
